package net.bungaeting.client.android.activity;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class Bungae_DB extends SQLiteOpenHelper {	
	public Bungae_DB (Context context) {
		super(context, "Client7.db", null, 1);
	}
	
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE groupInfo(_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
				"" + "groupName TEXT, parentGroupId INTEGER );");
		db.execSQL("CREATE TABLE groupUserInfo(_id INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ "groupInfo_inx INTEGER, userName TEXT, userPhone TEXT );");
		db.execSQL("CREATE TABLE selectedGroup(_id INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ "selectedGroupName TEXT, selectedTime TEXT, appointmentExplain TEXT, orgUserName TEXT" +
						", orgUserPhone TEXT, appointX TEXT, appointY TEXT, tagInfo INTEGER );");
		db.execSQL("CREATE TABLE selectedGroupUserInfo(_id INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ "selectedGroup_inx TEXT, selectedGroupName TEXT, userName TEXT, userPhone TEXT" +
						", userSelected TEXT );");
		db.execSQL("CREATE TABLE tagInfo(_id INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ "tagID INTEGER, tagName TEXT );");
	}
		 
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS product");
		onCreate(db);	  
	}
		
}
